// (c)2019 YanFriends Inc, All Rights Reserved.

package com.ysalliance.getFan.organization.network.api;


import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface UtilApi {
    @GET("/check/hx_service/")
    Observable<ResponseBody> getIsNeedHx(@Query("devices") String devices);

    @GET("users/oss/oss_token/")
    Observable<ResponseBody> getAliOss();



    //关注导师
    @FormUrlEncoded
    @POST("users/author/follow/")
    Observable<ResponseBody> followTutor(
            @Field("author_id") String author_id,
            @Field("types") String types);


    //关注导师
    @DELETE("/users/author/follow/")
    Observable<ResponseBody> defollowTutor(
            @Query("author_id") String author_id,
            @Query("types") String types);


    //我关注的导师
    @GET("/users/author/follow/")
    Observable<ResponseBody> getMyTutor(@Query("page") String pageId);


    //更新个人信息
    @FormUrlEncoded
    @PUT("/qcuser/{id}/")
    Observable<ResponseBody> updateUserInfo(
            @Path("id") String Id,
            @Field("username") String username,
            @Field("user_pic") String user_pic);


    //获得曲子的详情
    @GET("music/{id}/")
    Observable<ResponseBody> getMusicDetail(@Path("id") String id);




    /**   一对一课堂   */
    //导师创建一对一课程
    @FormUrlEncoded
    @POST("/course/")
    Observable<ResponseBody> createCourse(
            @Field("deadline") String deadline,
            @Field("id") String id,
            @Field("price") String price,
            @Field("name") String name,
            @Field("start_time") String start_time
    );
    //导师删除一对一课程
    @DELETE("/course/{id}/")
    Observable<ResponseBody> cancelCourse(
            @Path("id") String id
    );

    //更新一对一课堂
    @FormUrlEncoded
    @PUT("/course/{id}/")
    Observable<ResponseBody> updateCourse(

            @Field("deadline") String deadline,
            @Path("id") String Id,
            @Field("price") String price,
            @Field("name") String name,
            @Field("start_time") String start_time
    );



    //获得曲子的详情
    @GET("/groupperiod/")
    Observable<ResponseBody> getDiscount();




    //收藏
    @FormUrlEncoded
    @POST("/users/like/video_song/")
    Observable<ResponseBody> collect(
            @Field("types") String types,
            @Field("types_id") String types_id);
    //取消收藏
    @DELETE("/users/like/video_song/")
    Observable<ResponseBody> decollect(
            @Query("types") String types,
            @Query("types_id") String types_id);


    //获取用户收藏的视频
    @GET("users/like/video_song/")
    Observable<ResponseBody> getUserLikeVideo(@Query("types") String types,
                                              @Query("page") String pageId);

    //获取用户收藏的曲库
    @GET("users/like/video_song/")
    Observable<ResponseBody> getUserLikeMusic(@Query("types") String types,
                                              @Query("page") String pageId);






    //更新连麦状态
    @FormUrlEncoded
    @PUT("/course/{id}/state/")
    Observable<ResponseBody> updateHxVideo(
            @Path("id") String Id,
            @Field("connect") String connect
    );


    //更新连麦状态
    //开课日志:
           // 1. 进房成功: [%ld] / 进房失败: [%ld]
          //  2. 链接错误, errCode=%@, errMsg=%@
         //3. 已接收到对方视频数据/[roomID]接收不到对方视频,关闭链接
        //4. 对方离开房间
        //5. 退出房间
    @FormUrlEncoded
    @PUT("/course/{id}/state/")
    Observable<ResponseBody> updateHxVideo(
            @Path("id") String Id,
            @Field("connect") String connect,
            @Field("msg") String msg,
            @Field("state") String state
    );


    //创建退款订单
    @FormUrlEncoded
    @POST("/order/course/refund/")
    Observable<ResponseBody> refund(
            @Field("course") String order_id,
            @Field("amount") String amount,
            @Field("why_refund") String why_refund);



    //播放视频的次数统计
    @FormUrlEncoded
    @POST("/video/details/{id}/")
    Observable<ResponseBody> skanVideo(
            @Path("id") String VideoId,
            @Field("order_id") String order_id);

    //曲库的次数统计
    @GET("music/{id}/play/")
    Observable<ResponseBody> skanMusic(@Path("id") String id);


    //删除我的圈层
    @DELETE("/group/{id}/")
    Observable<ResponseBody> delCircle(@Path("id") String id);


    //导师创建圈层
    @FormUrlEncoded
    @POST("/group/")
    Observable<ResponseBody> createGroup(
            @Field("name") String name,
            @Field("intro") String intro,
            @Field("img") String img,
            @Field("price") String price,
            @Field("full_num") String full_number);


    //更新我的圈层
    @FormUrlEncoded
    @PUT("/group/{id}/")
    Observable<ResponseBody> updateCircle(
            @Path("id") String Id,
            @Field("name") String name,
            @Field("intro") String intro,
            @Field("img") String img,
            @Field("price") String price
    );




    //获取环信群组的群成员
    @GET("/group/{group_id}/members/")
    Observable<ResponseBody> getGroupMember(@Path("group_id") String group_id);


    //获取公告
    @GET("/group/{id}/")
    Observable<ResponseBody> getNotice(
            @Path("id") String id
    );


    //增加公告
    @FormUrlEncoded
    @POST("/group/{id}/announcement/")
    Observable<ResponseBody> addNotice(
            @Path("id") String id,
            @Field("announcement") String announcement);



    //登陆成功
    @FormUrlEncoded
    @POST("/users/authorizations/")
    Observable<ResponseBody> loginPassword(@Field("mobile") String mobile,
                                           @Field("password") String password,
                                           @Field("devices") String devices,              //  Android   设置为   1
                                           @Field("devices_id") String devices_id,
                                           @Field("devices_name") String devices_name     //
    );


    //登陆成功
    @FormUrlEncoded
    @POST("/check/bind/")
    Observable<ResponseBody> bindWeixin(@Field("wei_id") String wei_id,
                                        @Field("username") String username,
                                        @Field("user_pic") String user_pic

    );

    //获取视频的推荐视频
    @GET("/video/{id}/related/")
    Observable<ResponseBody> get_related_video(@Path("id") String video_id);


    //获取导师下的所有教学视频
    @GET("/video/author/{author_id}/")
    Observable<ResponseBody> get_tutor_video(@Path("author_id") String author_id);

    //获取范儿视频下的分类
    @GET("/video/classify/{type}/")
    Observable<ResponseBody> get_faner_video_class(@Path("type") String type,
                                                   @Query("page") String pageNumber

    );

    //获取圈子详情
    @GET("group/{id}/")
    Observable<ResponseBody> get_circlre(@Path("id") String id);



    //获取一对一视频的签名
    @GET("users/tls/sig/")
    Observable<ResponseBody> get_signature(@Query("course") String course);




    //获取验证码
    @GET("sms_codes/{mobile}&{types}/")
    Observable<ResponseBody> getLoginCode(@Path("mobile") String mobile, @Path("types") String types,
                                          @Query("area") String area);

    //登陆接口
    @FormUrlEncoded
    @POST("/users/login/")
    Observable<ResponseBody> login(@Field("login_type") String login_type,
                                   @Field("mobile") String mobile,
                                   @Field("sms_code") String sms_code,
                                   @Field("wei_id") String wei_id,
                                   @Field("qq_id") String qq_id,
                                   @Field("username") String username,
                                   @Field("user_pic") String user_pic,
                                   @Field("devices") String devices
    );


    //获取圈子详情
    @GET("institution/apply/")
    Observable<ResponseBody> get_organization();



    //登陆接口
    @FormUrlEncoded
    @POST("/institution/class/apply/")
    Observable<ResponseBody> creat_class(
                                   @Field("name") String name,
                                   @Field("institution") String institution
    );


    @GET("/video/search/")
    Observable<ResponseBody> getSearchVideo(@Query("name") String name,
                                            @Query("page") String page);



    //添加班级任务
    @FormUrlEncoded
    @POST("institution/class/task/apply/")
    Observable<ResponseBody> add_task(
            @Field("class") String class_id,
            @Field("name") String name,
            @Field("video") String video
    );

    //修改班级任务
    @FormUrlEncoded
    @PUT("institution/class/task/apply/")
    Observable<ResponseBody> update_task(
            @Field("task") String task_id,
            @Field("name") String name,
            @Field("video") String video
    );


    @GET("/institution/class/task/apply/")
    Observable<ResponseBody> getClassTask(
            @Query("class") String classid,
            @Query("page") String page
    );


    //删除任务
    @DELETE("/institution/class/task/apply/")
    Observable<ResponseBody> delete_task(
            @Query("task") String task_id);


    @GET("institution/class/apply/")
    Observable<ResponseBody> getClassInfo(
            @Query("class") String classid
    );


    //删除班级
    @DELETE("institution/class/apply/")
    Observable<ResponseBody> delete_class(
            @Query("class") String class_id);


    //查看班级所有成员
    @GET("institution/class/members/student/")
    Observable<ResponseBody> getClassStus(
            @Query("class") String classid,
            @Query("page") String page
    );


    //移除班级成员
    @DELETE("institution/class/members/student/")
    Observable<ResponseBody> remove_stu(
            @Query("members") String stu_id);

    //移除管理员成员
    @DELETE("institution/class/members/admin/")
    Observable<ResponseBody> remove_admin(
            @Query("members") String admin_id);



    //查看班级所有管理员
    @GET("institution/class/members/admin/")
    Observable<ResponseBody> getClassAdmins(
            @Query("class") String classid,
            @Query("page") String page
    );



    //搜索管理员
    @GET("institution/class/members/admin/search/")
    Observable<ResponseBody> search_admin(
            @Query("mobile") String classid
    );



    //添加班级管理员
    @FormUrlEncoded
    @POST("institution/class/members/admin/")
    Observable<ResponseBody> add_admin(
            @Field("class") String class_id,
            @Field("user") String user_id
    );





    //修改班级名称
    @FormUrlEncoded
    @PUT("institution/class/apply/")
    Observable<ResponseBody> change_class_name(
                                   @Field("class") String class_id,
                                   @Field("name") String  name

    );


    //查看具体任务
    @GET("institution/class/task/details/")
    Observable<ResponseBody> getTask(
            @Query("task") String taskid
    );





}
